package com.blog.webSocket.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 任浩
 * @version 1.0
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Message {

    //内容
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendTime;

    //发送者
    private String sender;

    //接收者
    private String receiver;

    private String senderId;

    //文本
    public static final int MESSAGE_TYPE_TEXT = 0;

    //图片
    public static final int MESSAGE_TYPE_IMAGE = 1;


    //关系表id
    private String linkId;

    //消息类型  0--普通文本（默认）
    private int type = MESSAGE_TYPE_TEXT;

    //是否为最后一条
    private Boolean isLatest;
}
